R code examples for SMA Slope, Elevation, and comparison using smatr3R version 4.0.5 (2021-03-31) -- "Shake and Throw"Smart (Standardised) Major Axis Estimation and Testing Routines, ver. 3.4-8Excel data input data files, available in this folder, were extracted directly from Appendix A. They are imported directly into R for these analyses, using the Import Dataset dropdown in R Studio.EXAMPLE 1: SMA bivariate slope (culmen vs. hallux claw) and elevation (of the SMA line) without correction for measurement error:library(readxl)Triple_Filtered_Culmen <- read_excel (�Triple_Filtered_Culmen.xlsx")View(Triple_Filtered_Culmen)  library(readxl)Triple_Filtered_Hallux_Claw <- read_excel (�Triple_Filtered_Hallux_Claw.xlsx")View(Triple_Filtered_Hallux_Claw) CulmenHClawAll<-line.cis(Triple_Filtered_Culmen, Triple_Filtered_Hallux_Claw, method=1)CulmenHClawAll#Output           coef(SMA) lower limit upper limitelevation  0.1053814  0.03982558   0.1709372slope     -1.2420355 -1.41535004  -1.0899439EXAMPLE 2: SMA bivariate slope (culmen vs. hallux claw) and elevation with correction for measurement error (V matrix):#Set Bill-Hallux Claw V matrixVBillHClaw<-matrix(0,2,2)VBillHClaw[1,1]<-0.0012VBillHClaw[2,2]<-0.0053VBillHClaw#Output       [,1]   [,2][1,] 0.0012 0.0000[2,] 0.0000 0.0053CulmenHClawAllVar<-line.cis(Triple_Filtered_Culmen, Triple_Filtered_Hallux_Claw, V = VBillHClaw)CulmenHClawAllVar
#Output           coef(SMA) lower limit upper limitelevation  0.1061245  0.04107926   0.1711697slope     -1.2723390 -1.44964186  -1.1167217EXAMPLE 3: Testing an SMA allometric slope (Culmen) against a constant expectation of 0.33, with correction for measurement error (V matrix):library(readxl)Triple_Filtered_Culmen <- read_excel (�Phylo_Filtered_Culmen.xlsx")View(Phylo_Filtered_Culmen)  library(readxl)Triple_Filtered_Weight <- read_excel (�Phylo_Filtered_Weight.xlsx")View(Phylo_Filtered_Weight)      #Set Bill-Wt V matrixVBillWt<-matrix(0,2,2)VBillWt [1,1]<-0.0012VBillWt [2,2]<-0.0060VBillWt#Output       [,1]  [,2][1,] 0.0012 0.000[2,] 0.0000 0.006BillSlopeTest<-slope.test(Phylo_filtered_Culmen, Phylo_filtered_Weight, test.value = 0.3333, data=NULL, method = 1, alpha = 0.05, VBillWt)BillSlopeTest#Output$F[1] 282.3107$r[1] 0.7511796$p[1] 0  #P-value too small to specify#Slope b = 0.7660336 very significantly greater than 1/3$test.value[1] 0.3333$b[1] 0.7660336$ci          [,1]      [,2][1,] 0.6868822 0.8543059EXAMPLE 4: Comparing the SMA allometric slopes (for Culmen) of two groups (Clingers vs. Non-clingers)library(readxl)Triple_Filtered_Culmen <- read_excel (�CulmenAllomAllGroupsNoOuts.xlsx")View(Triple_Filtered_Culmen)  sma(formula = CulmenAllomAllGroupsNoOuts) #OutputFit using Standardized Major Axis ------------------------------------------------------------Results of comparing lines among groups.H0 : slopes are equal.Likelihood ratio statistic : 0.2504 with 1 degrees of freedomP-value : 0.61678 ------------------------------------------------------------H0 : no difference in elevation.Wald statistic: 13.76 with 1 degrees of freedomP-value : 0.0002075 ----------------------------------------------------